import { connect } from "react-redux";
import { Nav } from "../components/Nav/nav";
import { Switch } from 'react-router-dom';
import { Route } from 'react-router-dom';
import { Redirect } from 'react-router-dom';
import { Foot } from './../components/Footer/foot';
import { Push } from './../components/Push/push';
import { Inter } from './../components/Inter/inter';

class InformUI extends React.Component {
    constructor(props) {
        super(props)
    }
    componentDidMount() {
        this.props.init();
    }
    render() {
        let { navList, footList } = this.props
        return (
            <div className="box">
                <header><Nav navList={navList} /></header>
                <main>
                    <Switch>
                        <Redirect from="/inform" exact={true} to="/inform/push" />
                        <Route path="/inform/push" component={Push} />
                        <Route path="/inform/inter" component={Inter} />
                    </Switch>
                </main>
                <footer><Foot footList={footList} /></footer>
            </div>
        )
    }
}
let mstp = state => {
    return {
        footList: state.home.footList,
        navList: state.inform.navList,
    }
};
let mdtp = (dispatch) => {
    return {
        init() {
        }
    }
}
export let Inform = connect(mstp, mdtp)(InformUI)